home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / recent / mcf4amrc.lha / MCF4AmIRC / Rexx / CTCP_Sound.AMIRX next >
Text File  |  1996-12-22  |  3KB  |  11 lines

  1. /* CTCP_Sound.AMIRX
  2. // $VER: CTCP_Sound.AMIRX 4.11 (22.12.96) (MCF Extra Command)
  3. \\ Written by Donald T. Becker (dtbecker@prolog.net) IRC: StarDustr
  4. // Please mail any bug reports/comments to the above address with a subject
  5. \\ header of MCF.AMIRX.
  6. //
  7. \\ ** What to do with this file?
  8. // Put this script in REXX:
  9. \\  Add the following Alias    S /Rx MCF_Sound %p
  10. */
  11. ;parse arg file who junk;if file="" then exit;if who="" then;do;options results;getchannel;who=result;end;MCFenv=address();xl=pos('.',MCFenv)+1;Client=substr(MCFenv,xl,1);SDC="SOUNDDIR."||Client;SD=getclip(SDC);SPC="SOUNDPLAYER."||Client;SoundPlayer=getclip(SPC);rpch=right(SD,1);if rpch ~="/"&rpch ~=":" then SD=SD||"/";if file ~='?' then;do;sfile=file;file=SD||sfile;signal SendSound;end;if ~show('L',"rexxreqtools.library") then;if ~addlib("rexxreqtools.library",0,-30,0) then exit 10;xl=length(SD);if ":"=substr(SD,xl) then;do;SDa=upper(left(SD,xl-1));if showlist("A",SDa) then call FindDir();if ":"=right(SD,1) then;xl=length(SD);else xl=length(SD)+1;end;file=rtfilerequest(SD);if file="" then exit;sfile=substr(file,xl+1);SendSound:;"echo P="d2c(27)"««MCF» Sending SOUND "d2c(2)||sfile|| d2c(2)" to "d2c(2)||who;"RAW PRIVMSG "who" :"d2c(1)"SOUND "sfile" ("sfile")"|| d2c(1);if ""=statef(file) then exit;PSC="PSOUND."||Client;if "Y"=getclip(PSC) then address command SoundPlayer file;exit;FindDir:;call GetDirs();if ~exists("T:MCF.SoundDir") then return;call open("Input","T:MCF.SoundDir","R");xx=readln("Input");SDirs="";do scnt=1 by 1 until eof("Input");xy="Send from this Dir?"||'0a'x||xx;SD=rtezrequest(xy,"_Yes|_No");if SD=1 then;do;SD=xx;leave;end;xx=readln("Input");end scnt;call close("Input");address command "Delete >nil: T:MCF.SoundDir";if SD="0" then exit;return;GetDirs:;address command "Assign >T:MCF.SDir Dirs";call open("Input","T:MCF.SDir","R");xx=upper(readln("Input"));acntr=0;do cnt=1 by 1 until eof("Input");parse value xx with yy zz junk;if yy=SDa then;do;do acntr=1 by 1 until yy ~="+";sd.acntr=zz;xx=upper(readln("Input"));parse value xx with yy zz junk;end acntr;call close("Input");if acntr=1 then;do;address command "Delete >nil: T:MCF.SDir";return;end;if ~open('console',"con:0/20/320/180/MCF Sound Directory Screen/CLOSE",'W') then;exit;len=writeln('console'," ");len=writeln('console'," ");len=writeln('console',"  Select Directory you wish to send a Sound from.");len=writeln('console'," ");len=writeln('console'," ");do bcntr=1 by 1 until bcntr=acntr;Oline=" " bcntr||":  " sd.bcntr;len=writeln('console',Oline);end bcntr;len=writeln('console'," ");ans=readln('console');call close('console');if ans<1|ans>bcntr then exit;SD=sd.ans;leave;end;xx=upper(readln("Input"));end;call close("Input");address command "Delete >nil: T:MCF.SDir";return